﻿using AutoMapper;
using CdhpyScheduler.Core;
using CdhpyScheduler.WebHost.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CdhpyScheduler.WebHost.PubMethod
{
    public class AutoMapperConfiguration
    {
        public static void Configure()
        {
            Mapper.Initialize(cfg =>
            {
                cfg.CreateMap<JobAPIModel, JobModel>()
                .ForMember(t => t.interval_type, s => s.MapFrom(ss => ss.interval_type == 2 ? JobModel_IntervalType.每天 : JobModel_IntervalType.每间隔一段时间));
            });
        }
    }
}